package com.cookie.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * component注解，表示这是一个组件，下面的注解需要该组件放入容器中才能生效
 * configuration properties 注解将本类中的所有属性和配置文件中的属性进行绑定
 * prefix 指定绑定的属性
 */
@Component
@ConfigurationProperties(prefix = "canal.conf")
public class CanalClientConfig {
    // 用于连接zk模式的canal
    private String zkServers;
    private String ip;
    private int port;
    private String destination;
    private String filter;  // 过滤要同步的表

    public String getZkServers() {
        return zkServers;
    }

    public void setZkServers(String zkServers) {
        this.zkServers = zkServers;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public String getFilter() {
        return filter;
    }

    public void setFilter(String filter) {
        this.filter = filter;
    }

    @Override
    public String toString() {
        return "CanalClientConfig{" +
                "zkServers='" + zkServers + '\'' +
                ", ip='" + ip + '\'' +
                ", port=" + port +
                ", destination='" + destination + '\'' +
                ", filter='" + filter + '\'' +
                '}';
    }
}
